import { useEffect } from "react";
import { Table } from "antd";
import { store } from "@/redux/index";

import "./index.less";

const MenuMange = () => {
	useEffect(() => {
		console.log(store.getState().menu.menuList, "---");
	}, []);

	const columns: any[] = [
		{
			title: "序号",
			render: (text: any, record: any, index: number) => <span>{index + 1}</span>
		},
		{
			title: "菜单显示",
			dataIndex: "title",
			key: "title"
		},
		{
			title: "路由Path",
			dataIndex: "path",
			key: "path"
		}
	];
	return (
		<div className="card content-box">
			<Table dataSource={store.getState().menu.menuList} columns={columns} rowKey="title" />
		</div>
	);
};

export default MenuMange;
